/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package generatorGraphics.graphicsCategory;

import generatorGraphics.graphics.GraphInterface;
import generatorGraphics.graphics.MoteLatency;
import generatorGraphics.graphics.Temperature;
import java.awt.GridBagConstraints;
import java.util.ArrayList;
import javax.swing.ImageIcon;

/**
 *
 * @author Heitor
 */
public class EnergyConsumption implements CategoryInterface{

    private String name;
    private int id;
    
    private int typeOptions;
    
    private ArrayList<GraphInterface> graphicsList;
    private ImageIcon image;
    
    private String pathImage = "/generatorGraphics/images/energyIcon.jpg";
    
    /**
     * Método extra para geração de icones (Em analise)
     */
    private static final GridBagConstraints gbc;  
    static {  
        gbc = new GridBagConstraints();  
        gbc.gridx = 0;  
        gbc.gridy = 0;  
        gbc.weightx = 1.0;  
        gbc.weighty = 1.0;  
        gbc.fill = GridBagConstraints.BOTH;  
        gbc.anchor = GridBagConstraints.NORTHWEST;  
    }
    
    public EnergyConsumption(){
        this.name = "Energy Consumption";
        this.id = 102;
        this.typeOptions = 3;
        
        this.graphicsList = new ArrayList<>();
        
        this.image = new ImageIcon(EnergyConsumption.class.getResource(pathImage));
        
        configuration();
    }
    
    private void configuration(){
    
        Temperature temp = new Temperature();
        graphicsList.add(temp);
        
        MoteLatency moteLatency = new MoteLatency();
        graphicsList.add(moteLatency);
    }
    
    public void addGraph(GraphInterface graph){
        graphicsList.add(graph);
    }
    
    public void removeAllGraph(){
        graphicsList.clear();
    }
    
    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public Integer getId() {
        return this.id;
    }

    @Override
    public ArrayList<GraphInterface> getGraphicsList() {
        return this.graphicsList;
    }

    @Override
    public ImageIcon getImage() {
        return this.image;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    @Override
    public Integer getTypeOptions() {
        return typeOptions;
    }
    
}
